/*******By DPH*******/
// 建网通过勤务帧实现

#ifndef SERVE_HELPER_H
#define SERVE_HELPER_H

#include <stdint.h>
#include "ns3/application-container.h"
#include "ns3/net-device-container.h"
#include "ns3/object-factory.h"
#include "ns3/ipv4-address.h"
#include "ns3/ipv4-interface-container.h"

namespace ns3{

class ServeHelper
{

public:
    // 构造函数
    ServeHelper ();
    
    // 设置属性
    void SetServeAttribute(std::string name, const AttributeValue &value);

    // 网卡安装应用
    ApplicationContainer InstallServe (Ptr<NetDevice> netDevice) const;
    ApplicationContainer InstallServe (NetDeviceContainer netDevice) const;
    //Ptr<Application> InstallServePriv(Ptr<NetDevice> netDevice) const;
    Ipv4InterfaceContainer InstallFixedAddress (Ptr<NetDevice> netDevice, Ipv4Address addr, Ipv4Mask mask);

private:
    Ptr<Application> InstallServePriv (Ptr<NetDevice> netDevice) const;
    ObjectFactory m_Factory;
    std::list<Ipv4Address> m_fixedAddresses;       //!< list of fixed addresses already allocated.
    std::list< std::pair <Ipv4Address, Ipv4Address> > m_addressPools; //!< list of address pools.

};

}// namespace ns3

#endif